package threading;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: xwl
 * Date: 2023-08-09
 * Time: 19:01
 */
public class ThreadDemo12 {
    public static void main (String[] args) throws InterruptedException {
        Object object = new Object();
        System.out.println("wait之前~");
        synchronized (object) {
            // wait主要做三件事 :解锁,阻塞等待,当收到通知时唤醒并尝试获取锁
            object.wait();
        }
        System.out.println("wait之后");
    }
}
